{% extends "base_sub.html" %}
{% import "/sideview/macros.html" as sideview %}

{% block title %}我的便笺框{% endblock title %}

{% block content %}
    <div id="memo_view" class="new_win">
        <h1 id="win_title">
            {% if kind == "recv" %}
                请参阅您收到的说明
            {% else %}
                查看已发送的便笺
            {% endif %}
        </h1>
        <div class="new_win_con2 fs-5 pt-3">
            <!-- 开始选择消息框 { -->
            <ul class="win_ul pb-3 px-4">
                <li class="{% if kind == "recv" %}selected{% endif %}"><a href="{{ url_for('memo_list') }}?kind=recv">收到一张纸条</a></li>
                <li class="{% if kind == "send" %}selected{% endif %}"><a href="{{ url_for('memo_list') }}?kind=send">已发送便笺</a></li>
                <li><a href="{{ url_for('memo_form') }}">写一个便条</a></li>
            </ul>
            <!-- } 提示框选择结束 -->
            <article id="memo_view_contents" class="mb-4 main-bt main-bb">
                <header>
                    <h2 class="blind">注释的内容</h2>
                </header>
                <div id="memo_view_ul" class="m-0 list-unstyled fs-5">
                    <div class="memo_view_li memo_view_name">
                        <ul class="memo_from position-relative d-flex main-bb p-4">
                            <li>
                              <div class="memo_view_nick mb-2">
                                {{ sideview.get(request, target.mb_id, getattr(target, "mb_nick", "[无会员信息]"))|safe }}
                              </div>
                              <div class="memo_view_date sub-font">
                                <span class="blind">收到时间</span>
                                <i class="fa fa-regular fa-clock" aria-hidden="true"></i>
                                {{ memo.me_send_datetime }}
                              </div>
                            </li>
                            <li class="memo_op_btn list_btn position-absolute" style="right: 55px;">
                                <a href="{{ url_for('memo_list') }}?{{ request.query_params }}" class="btn_b01 btn">
                                    <i class="fa fa-list" aria-hidden="true"></i>
                                    <span class="blind">列表</span>
                                </a>
                            </li>
                            <li class="memo_op_btn del_btn position-absolute" style="right: 15px;">
                                <a href="{{ url_for('memo_delete', me_id=memo.me_id) }}?{{ request.query_params }}" onclick="del(this.href); return false;" class="memo_del btn_b01 btn">
                                    <i class="fa fa-regular fa-trash-can" aria-hidden="true"></i>
                                    <span class="blind">删除</span>
                                </a>
                            </li>
                        </ul>
                        <div class="memo_btn d-flex w-100 bov-bg">
                            {% if prev_memo %}
                                <a href="{{ url_for('memo_view', me_id=prev_memo.me_id) }}?{{ request.query_params }}" class="btn_left w-50 p-4 fs-5 sub-font text-start me-auto">
                                    <i class="fa fa-chevron-left" aria-hidden="true"></i>&nbsp;上一个注释
                                </a>
                            {% endif %}
                            {% if next_memo %}
                                <a href="{{ url_for('memo_view', me_id=next_memo.me_id) }}?{{ request.query_params }}" class="btn_right w-50 p-4 fs-5 sub-font text-end ms-auto">
                                    下一个音符&nbsp;<i class="fa fa-chevron-right" aria-hidden="true"></i>
                                </a>
                            {% endif %}
                        </div>
                    </div>
                </div>
                <p class="p-3 fs-5" style="min-height: 150px;">{{ memo.me_memo }}</p>
            </article>
            <div class="win_btn">
                {% if kind == 'recv' %}
                    <a href="{{ url_for('memo_form') }}?me_id={{ memo.me_id }}" class="reply_btn">回复</a>
                {% endif %}
                <button type="button" onclick="window.close();" class="btn_close">窗口关闭</button>
            </div>
        </div>
    </div>
{% endblock content %}